/*
 db/schema.js contains database schema description for application models
 by default (when using jugglingdb as ORM) this file uses database connection
 described in config/database.json. But it's possible to use another database
 connections and multiple different schemas, docs available at

 http://railwayjs.com/orm.html

 Example of model definition:

 define('User', function () {
     property('email', String, { index: true });
     property('password', String);
     property('activated', Boolean, {default: false});
 });

 Example of schema configured without config/database.json (heroku redistogo addon):
 schema('redis', {url: process.env.REDISTOGO_URL}, function () {
     // model definitions here
 });

*/
var mongoose = require('mongoose');
var Schema = mongoose.Schema, ObjectId = Schema.ObjectId;
//console.log("url:"+Schema.settings.url);

var Post = describe('Post', function () {
    property('title', String);
    property('content', String);
	property('comment', [Test]);
});

var Test = describe('Post', function () {
    property('title', String);
    property('content', String);
	property('comment', Object);
});

var Blog = describe('Blog', function () {
    property('uid', ObjectId);
    property('type', String);
    property('title', String);
    property('content', String);
    property('createAt', Date);
    property('richContent', Object);
});
var FollowedMe = describe('FollowedMe', function () {
    property('uid', ObjectId);
    property('fid', ObjectId);	
});
var IFollowed = describe('IFollowed', function () {
    property('uid', ObjectId);
    property('fid', ObjectId);
});
var Inbox = describe('Inbox', function () {
    property('uid', ObjectId);
    property('bid', ObjectId);
    property('buid', ObjectId);
});
var Group = describe('Group', function () {
    property('groupName', String);
    property('uid', ObjectId);
});
var GroupUser = describe('GroupUser', function () {
    property('groupId', ObjectId);
    property('uid', ObjectId);
});var User = describe('User', function () {
    property('userName', String);
    property('pwd', String);
    property('email', String);
});